package com.cm.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Email;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
@ConfigurationProperties(prefix = "person")//在yaml文件中进行绑定
@Validated//数据校验
public class Person {
    private String name;
    @Email(message = "邮箱格式不正确")//数据校验支持的
    private String email;
}
